<template>
    <div>
        <el-card>
            <div slot="header">
                <span>环境指标</span>
            </div>
           <el-table
            :data="tableData"
            stripe
            style="width: 100%">
                <el-table-column
                prop="position"
                label=""
                width="180">
                </el-table-column>
                <el-table-column
                prop="CO"
                label="CO浓度(ppm)"
                width="180">
                </el-table-column>
                <el-table-column
                prop="VI"
                label="VI能见度(m-1)"
                width="180">
                </el-table-column>
                <el-table-column
                prop="lightout"
                label="洞外亮度(cd/m2)">
                </el-table-column>
                <el-table-column
                prop="lightin"
                label="洞内亮度(lx)">
                </el-table-column>
            </el-table>
            <HR align=center width='100%' color=#987cb9 SIZE=1 style="margin: 10px 0px;"/>
            <div style="text-align: center;">
                <el-button>数据刷新</el-button>
                <el-button>统计报表</el-button>
            </div>
        </el-card>
    </div>
</template>
<script>

import reportService from '../../../services/reportService'

export default {

    data(){
        return {
            tableData: []
        }
    },

    mounted(){
        let _this = this
        reportService.getrealEnvironDataBySectionCode().then(res => {
            if (res.msg == 'success') {
                _this.tableData = []
                _this.tableData.push({position: '左洞入口',CO: res.data.leftInCO, VI: res.data.leftInVI, lightout: res.data.leftInOUTSIDELIGHT, lightin: res.data.leftInINSIDELIGHT})
                _this.tableData.push({position: '左洞出口',CO: res.data.leftOutCO, VI: res.data.leftOutVI, lightout: res.data.leftOutOUTSIDELIGHT, lightin: res.data.leftOutINSIDELIGHT})
                _this.tableData.push({position: '右洞入口',CO: res.data.rightInCO, VI: res.data.rightInVI, lightout: res.data.rightInOUTSIDELIGHT, lightin: res.data.rightInINSIDELIGHT})
                _this.tableData.push({position: '右洞出口',CO: res.data.rightOutCO, VI: res.data.rightOutVI, lightout: res.data.rightOutOUTSIDELIGHT, lightin: res.data.rightOutINSIDELIGHT})
            }
        })
    }
}
</script>
<style lang="scss" scoped>

.fl-r{
    float: right;
}

.content{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.content-item{
    text-align: center;
}
</style>
